package de.fzi.kasma.learner.function.kernel;

import de.fzi.kasma.learner.data.Data;
import de.fzi.kasma.learner.data.Dataset;
import edu.unika.aifb.graphindex.storage.StorageException;

public class KernelMatrix {
	
	
	public double [][] matrix;
	
	
	public KernelMatrix(Dataset dataset, HypothesisKernel kernel){

		Data[] orderedData = dataset.getAllData();
		matrix = new double [orderedData.length][orderedData.length];

		for (int i = 0; i < matrix.length; i++) {
			for (int j = 1; j < matrix.length; j++) {
				try {
					matrix[i][j] = kernel.getSimilarity(orderedData[i], orderedData[j], dataset);
				} catch (StorageException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}	
		}

	}
}
